import React, { useState } from 'react';
// 自定义的hooks
// useLoading
// useMyReducer

const useMyReducer = (reducer: any, initialState: any) => {
  console.log(initialState, ": ========initialState")

  const [state, setState] = useState(initialState);
  const dispatch = (action: any) => {
    const newState = reducer(state, action);
    setState(newState);
  };

  return [state, dispatch];
};

export default useMyReducer